<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">

	</head>
	<body>
		
		<div id="app">
			
		<span v-for="item in array">{{item}} </span><br/>
		数据：<input type="text" v-model="num"/><br />
		<button @click="push">push</button>
		<button @click="pop">pop</button>
		<button @click="shift">shift</button>
		<button @click="splice">splice</button>
		
		</div>
		<script src="../js/vue.js"></script>
		<script>
			
			const app=new Vue({
				el:"#app",
				data:{
				array:[3,7,5,1,4],
				num:''
				},
				methods:{
				push(){
					this.array.push(this.num)
				},
				pop(){
					this.array.pop()
				},
				shift(){
					this.array.shift()
				},
				splice(){
					//三个参数，
					// this.array.splice(0,1,5)
					// this.array.splice(0,2,8,9)
					// this.array.splice(3,1,'')
					this.array.splice(3,1)
				}
				}
			})
		</script>
	</body>
</html>
